//
//  ReadBottomBar.swift
//  Spookiness
//
//  Created by 腾億 on 2017/12/21.
//  Copyright © 2017年 tml. All rights reserved.
//

import UIKit

class ReadBottomBar: UIView {

    lazy var menuSlider: UISlider = {
        let slider = UISlider()
        slider.thumbTintColor = kRGBA(r: 29, g: 221, b: 43, a: 1)
        slider.minimumTrackTintColor = kRGBA(r: 29, g: 221, b: 43, a: 1)
        slider.isContinuous = false
        return slider
    }()
    
    lazy var deviceDirectionButton: UIButton = {
        let button = UIButton(type: .custom)
        button.setImage(#imageLiteral(resourceName: "readerMenu_changeScreen_horizontal"), for: .normal)
        return button
    }()
    
    lazy var lightButton: UIButton = {
        let button = UIButton(type: .custom)
        button.setImage(#imageLiteral(resourceName: "readerMenu_luminance"), for: .normal)
        return button
    }()
    
    lazy var chapterButton: UIButton = {
        let button = UIButton(type: .custom)
        button.setImage(#imageLiteral(resourceName: "readerMenu_catalog"), for: .normal)
        return button
    }()
    
    fileprivate func setUpSnap() {
        addSubview(menuSlider)
        self.menuSlider.snp.makeConstraints { (make) in
            make.left.right.top.equalToSuperview().inset(UIEdgeInsetsMake(10, 40, 10, 40))
            make.height.equalTo(30)
        }
        
        addSubview(deviceDirectionButton)
        addSubview(lightButton)
        addSubview(chapterButton)
        let buttonArray = [deviceDirectionButton, lightButton, chapterButton]
        buttonArray.snp.distributeViewsAlong(axisType: .horizontal, fixedItemLength: 60, leadSpacing: 40, tailSpacing: 40)
        buttonArray.snp.makeConstraints {
            $0.top.equalTo(menuSlider.snp.bottom).offset(10)
            $0.bottom.equalToSuperview()
        }
    }
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        setUpSnap()
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    
    
}
